package itdep.domain.division;

import itdep.domain.IisEntity;
import itdep.domain.profile.Profile;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * @author Ivan Khalopik
 * @version $Revision: 52 $ $Date: 2010-07-06 10:22:21 +0000 (Tue, 06 Jul 2010) $
 */
@Entity
@Table(name = "EMPLOYEE")
public class Employee extends IisEntity {

	@OneToOne
	private Profile profile;

	@ManyToOne
	@JoinColumn(name = "ID_DEGREE", nullable = false)
	private Degree degree;

	@ManyToOne
	@JoinColumn(name = "ID_RANK", nullable = false)
	private Rank rank;

	@OneToMany(mappedBy = "employee")
	private Set<EmployeePosition> employeePositions = new HashSet<EmployeePosition>();

	public Degree getDegree() {
		return degree;
	}

	public void setDegree(final Degree degree) {
		this.degree = degree;
	}

	public Rank getRank() {
		return rank;
	}

	public void setRank(final Rank rank) {
		this.rank = rank;
	}

	public Set<EmployeePosition> getEmployeePositions() {
		return employeePositions;
	}

	public void setEmployeePositions(Set<EmployeePosition> employeePositions) {
		this.employeePositions = employeePositions;
	}
}